#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Time    : 2021/6/19 10:54
# @Author  : Aaron
# @File    : calculator.py
# @Software: PyCharm

class Calculator:
    def add(self, a, b):
        if isinstance(a, float) or isinstance(b, float):
            return round(a + b, 3)
        return a + b

    def sub(self, a, b):
        return a - b

    def mul(self, a, b):
        return a * b

    def div(self, a, b):
        return round(a / b, 3)
